#include <iostream>
#include <algorithm>

std::vector<int> *getVector()
{
    std::vector<int> *v = new std::vector<int>();
    for (int i = 0; i < 10; i++)
    {
        v->push_back(i);
    }
    return v;
}

class Print
{
public:
    void operator()(const int &i)
    {
        std::cout << i << " ";
    }
};

void print(const int &i)
{
    std::cout << i << " ";
}

int main(int argc, char const *argv[])
{

    std::vector<int> *v = getVector();
    // std::for_each(v->begin(), v->end(), Print());
    std::for_each(v->begin(), v->end(), print);
    std::cout << std::endl;

    return 0;
}
